﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace OLMS_MVC2.Models
{
    public class RegisterViewModel
    {
        [Required(ErrorMessage = "登录账号不能为空")]
        [StringLength(20, MinimumLength = 4, ErrorMessage = "账号长度需在4-20个字符之间")]
        public string LoginId { get; set; }

        [Required(ErrorMessage = "密码不能为空")]
        [StringLength(20, MinimumLength = 6, ErrorMessage = "密码长度需在6-20个字符之间")]
        public string LoginPwd { get; set; }

        [Required(ErrorMessage = "请确认密码")]
        [Compare("LoginPwd", ErrorMessage = "两次输入的密码不一致")]
        public string ValidLoginPwd { get; set; }

        [Required(ErrorMessage = "用户名不能为空")]
        public string UserName { get; set; }

        [Required(ErrorMessage = "联系电话不能为空")]
        [Phone(ErrorMessage = "请输入有效的电话号码")]
        public string Phone { get; set; }
    }
}